import { request } from '../http'

export function fetchUserList(params?: any) {
    return request.Get('/system/user/list', { params })
}
export function changeUserStatus(userId: number, status: string) {
    const data = {
        userId,
        status
    }
    return request.Put('/system/user/changeStatus', data)
}

// 获取角色权限
export function getRole(userId: number) {
    return request.Get(`/system/user/authRole/${userId}`)
}
// 分配角色权限
export function upRole(params?: any) {
    return request.Put(`/system/user/authRole`,"",{params} )
}
// 查询权限列表
export function selectRoleList() {
    return request.Get(`/system/role/optionselect`)
}
// 新增用户
export function addUser(data: any) {
    return request.Post(`/system/user`,data)
}

// 修改用户
export function updateUser(data: any) {
    return request.Put(`/system/user`, data)
}

// 删除用户
export function delUser(userId: number) {
    return request.Delete(`/system/user/${userId}`,)
}
